#ifndef SANGAME_BASE_LOCK_H_
#define SANGAME_BASE_LOCK_H_

#include "base/base_export.h"
#include "base/base.h"

namespace sangame {
namespace base {

class BASE_EXPORT Lock {
public:
    class BASE_EXPORT Mutex {
    public:
        Mutex();
        ~Mutex();

    private:
        friend class Lock;
        void Lock();
        void UnLock();

        CRITICAL_SECTION critical_section_;
    };

    Lock(Mutex &mutex);
    ~Lock();

private:
    Mutex& mutex_;

};

} // namespace base
} // namespace sangame

#endif // SANGAME_BASE_LOCK_H_